#!/usr/bin/env python
#
# pystrips.py is part of pyStrips
# Copyright (C) - 2009 - Juan B. Cabral <jbcabral_89@yahoo.com.ar>

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

################################################################################
# DOCS
################################################################################
'''Simple 'strips language' interpreter'''


################################################################################
# IMPORTS
################################################################################

import common
import error
import pre_processor
import syntax
import semantic
import solver

################################################################################
# META
################################################################################

__prog_name__ = 'pyStrips' 
__author__ = 'JuanBC <jbc.develop@gmail.com>'
__version__ = '0.0.1'
__date__ = 'May 2009'
__copyright__ = 'Copyright (c) 2009 Juan Cabral'
__license__ = 'GNU General Public License  version 3'


################################################################################
# MAIN
################################################################################

if __name__ == '__main__':
    src = ""
    try:
        src = open("blocks.strips").read()
        src_yml = pre_processor.pre_process(src)
        st_list = syntax.validate(src_yml)
        st_g = semantic.validate(st_list)
        solver.solve(st_g, 2)
    except error.PyStripsError as err:
        err.calculate_line_number(src)
        raise err
